package casa.depesos.app.com.http.bean;

import com.google.gson.Gson;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import casa.depesos.app.com.http.BaseBean;
import casa.depesos.app.com.http.data.WhiteData;

public class WhiteDataBean extends BaseBean {

    @SerializedName("dataRecord")
    @Expose
    private String data;

    WhiteData tmp = null;

    public WhiteDataBean(WhiteData data) {
        tmp = data;
    }

    public WhiteData getData() {
        if (tmp == null) {
            try {
                tmp = new Gson().fromJson(data, WhiteData.class);
            } catch (Throwable e) {
                e.printStackTrace();
            }
        }
        return tmp;
    }

    @Override
    public boolean isValid() {
        WhiteData data = getData();
        return data != null && data.me != null;
    }
}
